package cn.com.shaom.learning.sb.data.mybatis.mapper.config;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Repository;

/**
 * ClassName: MyBatisConfig
 * Description: 这边的配置可以省略， @MapperScan 注解直接放在启动类 SpringbootDataMybatisApplication
 * Date: 2018/1/2 17:05 【需求编号】
 *
 * @author Shaom
 * @version V1.0.0
 */
@Configuration
@MapperScan(value = {MyBatisConfig.MAPPER_PACKAGE}, annotationClass = Repository.class)
public class MyBatisConfig {

    static final String MAPPER_PACKAGE = "cn.com.shaom.learning.sb.data.mybatis.mapper.dao";

    // 原作者说，通用mapper不能被扫描？这边扫描范围放大，的确是会报错
    // 解决方法，1、缩小范围；2、精确扫描（添加 annotationClass = Repository.class ），每个具体的Mapper上添加注解
//    static final String MAPPER_PACKAGE = "cn.com.shaom.learning.sb.data.mybatis.mapper";


}
